execute as @e[type=marker,nbt={Tags:["battery_box"]}] at @s run execute at @s unless block ~ ~ ~ chest{CustomName:'{"text":"Battery Box"}'} run kill @s
execute as @e[type=marker,nbt={Tags:["battery_box"]}] at @s if score @s advm_power matches 1.. run title @a[distance=..2] actionbar [{"score":{"name": "@e[type=marker,limit=1,distance=..1,sort=nearest]","objective": "advm_power"},"color": "aqua"},{"text": " ⚡","color": "yellow"}]
execute as @e[type=marker,nbt={Tags:["battery_box"]}] at @s unless score @s advm_power matches 1.. run title @a[distance=..2] actionbar [{"score":{"name": "@e[type=marker,limit=1,distance=..1,sort=nearest]","objective": "advm_power"},"color":"red"},{"text": " ⚡","color": "yellow"}]

execute as @e[type=marker,nbt={Tags:["battery_box"]}] at @s if score @s advm_power matches ..0 run function advm:machines/battery_box_charge

execute as @e[type=marker,nbt={Tags:["burn_electricity_producer"]}] at @s run execute at @s unless block ~ ~ ~ dropper{CustomName:'{"text":"Burn Electricity Producer"}'} run kill @s
execute as @e[type=marker,nbt={Tags:["burn_electricity_producer"]}] at @s if score @s advm_power matches 1.. run title @a[distance=..2] actionbar [{"score":{"name": "@e[type=marker,limit=1,distance=..1,sort=nearest]","objective": "advm_power"},"color": "aqua"},{"text": " ⚡","color": "yellow"}]
execute as @e[type=marker,nbt={Tags:["burn_electricity_producer"]}] at @s unless score @s advm_power matches 1.. run title @a[distance=..2] actionbar [{"score":{"name": "@e[type=marker,limit=1,distance=..1,sort=nearest]","objective": "advm_power"},"color":"red"},{"text": " ⚡","color": "yellow"}]
execute as @e[type=marker,nbt={Tags:["burn_electricity_producer"]}] at @s run function advm:machines/burn_electricity_checker

execute as @e[type=marker,nbt={Tags:["wind_electricity_producer"]}] at @s run execute at @s unless block ~ ~ ~ cyan_glazed_terracotta run kill @s
execute as @e[type=marker,nbt={Tags:["wind_electricity_producer"]}] at @s if score @s advm_power matches 1.. run title @a[distance=..2] actionbar [{"score":{"name": "@e[type=marker,limit=1,distance=..1,sort=nearest]","objective": "advm_power"},"color": "aqua"},{"text": " ⚡","color": "yellow"}]
execute as @e[type=marker,nbt={Tags:["wind_electricity_producer"]}] at @s unless score @s advm_power matches 1.. run title @a[distance=..2] actionbar [{"score":{"name": "@e[type=marker,limit=1,distance=..1,sort=nearest]","objective": "advm_power"},"color":"red"},{"text": " ⚡","color": "yellow"}]
